/*
** event.c for event in /home/gjura_r//SDL/projet/sdl-mario
** 
** Made by romain gjura
** Login   <gjura_r@epitech.net>
** 
** Started on  Fri Apr 12 17:11:14 2013 romain gjura
** Last update Sat Apr 13 10:48:36 2013 romain gjura
*/

#include <stdio.h>
#include <stdlib.h>
#include <SDL/SDL.h>
#include "./includes/draw.h"

int		wait_for_event(t_aff *aff, t_map *map)
{
  int		loop = 1;

  while (loop)
    {
      SDL_PollEvent(&aff->event);
      switch (aff->event.type)
	{
	case SDL_QUIT:
	  loop = 0;
	  break;
	case SDL_KEYDOWN:
	  if (aff->event.key.keysym.sym == SDLK_ESCAPE)
	    exit(EXIT_SUCCESS);
	}
    }
  return EXIT_SUCCESS;
}
